Skip to content

Move task instance state enums out of airflow.utils.state - #71193

Draft
rjgoyln wants to merge 2 commits into
apache:mainfrom
rjgoyln:move-ti-state-enums-to-airflow-task
Draft

Move task instance state enums out of airflow.utils.state#71193
rjgoyln wants to merge 2 commits into
apache:mainfrom
rjgoyln:move-ti-state-enums-to-airflow-task

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

airflow.utils has accumulated modules that belong elsewhere, and untangling it is a prerequisite for the client-server separation. TerminalTIState and IntermediateTIState describe the Execution API's task lifecycle protocol, so they move to airflow.task.state, where TriggerRule and WeightRule already live. Enum values are unchanged, so the Execution API schema and the generated Task SDK client are untouched.

The parent epic (#53385) names airflow.sdk.definitions.state as the target. airflow.task.state is where the rest of this batch landed, the Task SDK never imported airflow.utils.state, and moving these into the SDK would add an airflow-core → task-sdk import that #62061 is working to remove. Straightforward to redirect if the epic's target is preferred.

Both enums also drop off the airflow.utils.state page listed in public-airflow-interface.rst without a replacement entry, matching how trigger_rule and weight_rule were handled.

Compatibility

The old attribute paths still resolve and emit a DeprecationWarning. The Google provider's TYPE_CHECKING import moves to the new path because the old one no longer resolves statically.

closes: #54899
closes: #54900


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

airflow.utils has become a dumping ground, and untangling it is a
prerequisite for the client-server separation work. TerminalTIState and
IntermediateTIState describe the Execution API's task lifecycle protocol
and belong next to TriggerRule and WeightRule, which moved to
airflow.task for the same reason.

The old import paths keep working through the same backwards-compatible
shim that the sibling JobState move already established in this module.
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:providers area:task-sdk provider:google Google (including GCP) related issues labels Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:providers area:task-sdk provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor IntermediateTIState enum across Airflow components Refactor TerminalTIState enum across Airflow components

1 participant